// Text of project Checkbook written on 2/28/96 at 7:00 PM
// Beginning of text file Constants.f
/*
**      Newton Developer Technical Support Sample Code
**
**      Checkbook, a complete NewtApp sample
**
**      by Neil Rhodes, Calliope &
**		  Newton Developer Technical Support
**
**      Copyright © 1994-6 by Apple Computer, Inc.  All rights reserved.
**
**      You may incorporate this sample code into your applications without
**      restriction.  This sample code has been provided "AS IS" and the
**      responsibility for its operation is 100% yours.  You are not
**      permitted to modify and redistribute the source as "DTS Sample Code."
**      If you are going to re-distribute the source, we require that you
**      make it clear in the source that the code was descended from
**      Apple-provided sample code, but that you've made changes.
*/


OpenResFile(HOME & "Icons.rsrc");
DefConst('kReconciledIcon, GetPictAsBits("Reconcile", nil));
DefConst('kSmallCheckIcon, GetPictAsBits("SmallCheck", nil));
CloseResFile();

DefConst( 'kPrefsTemplate, {autoDate: nil,
							autoCheckNum: nil});

// Modify these numbers to do testing
constant kMaxWidth := 320;
constant kMaxHeight := 320;

constant kMinWidth := 200;
constant kMinHeight := 200;

// Define data symbols (used for routing)
constant kCheckClassSym 			:= '|Check:Checkbook:PIETraining|;
constant kCheckFrameFormatSym 		:= '|FrameFormat:Checkbook:PIETraining|;
constant kCheckPrintFormatSym 		:= '|ViewFormat:Checkbook:PIETraining|;

// Define a 'routing format' to handle frames (beam, mail, etc)
// By default, protoFrameFormat handles text also; override 'dataTypes to change that.
// Register a separate protoPrintFormat (see the allViewDefs slot in the base view)
// if you want to support print and fax.
DefConst('kCheckFrameFormat, {
	_proto: protoFrameFormat,
	name: "Check frame Format",
	symbol: kCheckFrameFormatSym,
	TextScript: func(item, target)
		begin
			// ... export text if possible.
			// if format.textScript isn't present but a dataDef is, the datadef's
			// textscript will be used to export the text
			
			local string := "Check" & target.number;
			if target.date then
				string := string && "\nDate" && datentime(target.date);
			if target.payee then
				string := string && "\nto" && target.payee;
			if target.amount then
				string := string && "\n$" & formattednumberstr(target.amount, "%.2f");

			if target.reconciled then
				string := string & "\nReconciled";
			else
				string := string & "\nUnreconciled";

			if target.memo then
				string := string && "\nMemo: " && target.memo;

			string;
		end,
		
	SetupItem: func(item, targetInfo)
		begin
			// set up the routing item if necessary
			inherited:?SetupItem(item, targetInfo);

			local string := "Check" && targetInfo.target.number;
			if targetInfo.target.payee then
				string := string && "to" && targetInfo.target.payee;
			
			item.title := string
		end;
		
	});
// End of text file Constants.f
// Beginning of file protoCheckAllButton

// Before Script for "protoCheckAllButton"
// Copyright ©1995 Apple Computer, Inc.  All rights reserved.

// This file shows how to create a simple button which does a "check all"
// for an overview.


protoCheckAllButton :=
    {viewBounds: {left: 7, top: 0, right: 33, bottom: 13},
     buttonClickScript:
       func()
       	if currentLayout = 'overView then
       		begin
       			For i:=0 to (layout.numLines-1) do
       				layout:SelectItem(i);
       			layout:Retarget(true);
       		end;,
     icon: GetPictAsBits("checkAll", nil),
     debug: "protoCheckAllButton",
     _proto: @198
    };


constant |layout_protoCheckAllButton| := protoCheckAllButton;
// End of file protoCheckAllButton
// Beginning of file New Button.t
_view000 :=
    {
     buttonClickScript:
       func()
       	base:NewCheck();,
     text: "New",
     viewBounds: {left: 7, top: 0, right: 50, bottom: 13},
     _proto: @226
    };


constant |layout_New Button.t| := _view000;
// End of file New Button.t
// Beginning of file Default View.t

// Before Script for "_view001"
// Copyright ©1995 Apple Computer, Inc.  All rights reserved.


_view001 :=
    {viewBounds: {left: 0, top: 20, right: 0, bottom: -20},
     masterSoupSlot:
       // refers to a slot in the allSoups frame
       // see newtApplication.allsoups in CheckBase.t
       'checkSoup,
     name: "Check",
     viewJustify: 240,
     forceNewEntry: nil,
     menuLeftButtons:
       // these will replace the menuLeftButtons in the newtStatusBar in the
       // base view, because the 'statusBarSet in the base view is set to the
       // declared name of the status bar.
       // Note that we do not replace the menuRightButtons.
       [
       	newtInfoButton,
       	{	
       		_proto: protoRecToggle,
       		_recogPopup: ['recogText, 'recogInkText, 'pickseparator, 'recToggleSettings],
       	},
       	GetLayout("New Button.t"),
       ],
     _proto: @402
    };

entryView :=
    {viewBounds: {left: 0, top: 0, right: 0, bottom: 0},
     viewJustify: 240,
     DoInit:
       func(symbol, textView)
       	begin
       		local s := GetUserConfig(symbol);
       		
       		if not s then
       			s := "";
       		SetValue(self.(textView), 'text, Clone(s));
       	end,
     viewSetupDoneScript:
       func()
       begin
       	:DoInit('name, 'theName);
       	:DoInit('address, 'theAddress);
       	:DoInit('cityZip, 'theCityZip);
       	inherited:?viewSetupDoneScript();
       end,
     viewSetupChildrenScript:
       func()
       	// don't want anything to show up if the folder is empty
       	if not target then
       		stepChildren := nil;,
     debug: "entryView",
     _proto: @406
    };
AddStepForm(_view001, entryView);

theName :=
    {text: "",
     viewBounds: {left: 0, top: 0, right: 110, bottom: 14},
     debug: "theName",
     _proto: @218
    };
AddStepForm(entryView, theName);
StepDeclare(entryView, theName, 'theName);



theAddress :=
    {text: "",
     viewBounds: {left: 0, top: 0, right: 0, bottom: 14},
     viewJustify: 8398384,
     debug: "theAddress",
     _proto: @218
    };
AddStepForm(entryView, theAddress);
StepDeclare(entryView, theAddress, 'theAddress);



theCityZip :=
    {text: "",
     viewBounds: {left: 0, top: 0, right: 0, bottom: 14},
     viewJustify: 8398336,
     debug: "theCityZip",
     _proto: @218
    };
AddStepForm(entryView, theCityZip);
StepDeclare(entryView, theCityZip, 'theCityZip);



number :=
    {viewBounds: {left: -100, top: 27, right: -5, bottom: 53},
     path: 'number,
     viewJustify: 32,
     flavor:
       {
       	_proto: newtIntegerFilter,
       	recConfig: nil,	// prevent ink
       },
     debug: "number",
     _proto: @423
    };
AddStepForm(entryView, number);



amount :=
    {viewBounds: {left: 4, top: 0, right: 35, bottom: 26},
     path: 'amount,
     viewJustify: 134225920,
     flavor:
       {
       	_proto: newtNumberFilter,
       	format: kFnBasicCurrency,
       	recConfig: nil,	// prevent ink
       };,
     debug: "amount",
     _proto: @423
    };
AddStepForm(entryView, amount);



date :=
    {viewBounds: {left: -65, top: 0, right: -5, bottom: 26},
     path: 'date,
     viewJustify: 67125280,
     flavor:
       {
       	_proto: newtDateFilter,
       	recConfig: nil,	// prevent ink
       };,
     debug: "date",
     _proto: @424
    };
AddStepForm(entryView, date);



payee :=
    {viewBounds: {left: 5, top: 0, right: -5, bottom: 30},
     path: 'payee,
     label: "Payee",
     viewJustify: 8240,
     debug: "payee",
     _proto: @422
    };
AddStepForm(entryView, payee);



memo :=
    {viewBounds: {left: 5, top: 0, right: -5, bottom: 30},
     path: 'memo,
     label: "Memo",
     viewJustify: 8240,
     debug: "memo",
     _proto: @422
    };
AddStepForm(entryView, memo);



reconciled :=
    {path: 'reconciled,
     viewJustify: 8246,
     viewBounds: {left: 5, top: 0, right: -5, bottom: 30},
     TargetData:
       func()
       	if target and path then
       		if target.(path) then
       			"Reconciled"
       		else
       			"Unreconciled",
     debug: "reconciled",
     _proto: @414
    };
AddStepForm(entryView, reconciled);






constant |layout_Default View.t| := _view001;
// End of file Default View.t
// Beginning of file Overview.t

// Before Script for "overview"
// Copyright ©1995 Apple Computer, Inc.  All rights reserved.


overview :=
    {viewBounds: {left: 0, top: 20, right: 0, bottom: -20},
     masterSoupSlot:
       'checkSoup	// which soup to get info from.
       ,
     name: "Overview",
     viewJustify: 240,
     viewFormat: 336,
     forceNewEntry:
       nil	// don't create a new item if folder is empty
       ,
     viewSetupChildrenScript:
       func()
       	begin
       		if not smallCheckShape then
       			begin
       				// create shapes from bitmaps for the icons in each item
       				smallCheckShape := OffsetShape(MakeShape(kSmallCheckIcon), 0, 5);
       				reconciledShape := OffsetShape(MakeShape(kReconciledIcon), 0, 3);
       			end;
       		inherited:?viewSetupChildrenScript();
       	end,
     lineHeight: 17,
     smallCheckShape:
       nil	// viewSetupChildrenScript will create the shape from a bitmap (see Constants.f)
       ,
     reconciledShape:
       nil	// viewSetupChildrenScript will create the shape from a bitmap (see Constants.f)
       ,
     menuLeftButtons:
       // these will replace the menuLeftButtons in the newtStatusBar in the
       // base view, because the 'statusBarSet in the base view is set to the
       // declared name of the status bar.
       // Note that we do not replace the menuRightButtons.
       
       [
       	newtInfoButton,
       	GetLayout("New Button.t"),
       	GetLayout("protoCheckAllButton"),
       ],
     OverviewAbstract:
       func(item, bBox)
       	begin
       		// create a string with date, check #, amount, and "to"
       		local s := ShortDateStr(item.date, 0);
       		s := s && $# & NumberStr(item.number);
       		if item.amount then
       			s := s && FormattedNumberStr(item.amount, kFnBasicCurrency);
       		s := s && "to" && item.payee;
       
       		// build the shape.  Take advantage of an offset transform so we can
       		// use the same reconciledShape or smallCheckShape for each item
       		// (we need the style frame anyway to set the font for the text shape.)
       		[
       			{transform: [bbox.left, bbox.top],
       			 font: '{family: espy, face: 1, size: 10}},
       			if item.reconciled then reconciledShape else smallCheckShape,
       			MakeText(s, 20, 0, bbox.right-bbox.left-20, 15),
       		];
       	end,
     debug: "overview",
     _proto: @405
    };


constant |layout_Overview.t| := overview;
// End of file Overview.t
// Beginning of file CheckPrintViewDef.t
print :=
    {symbol: kCheckPrintFormatSym,
     version: 1,
     name: "Single Check",
     printNextPageScript:
       func()
       begin
       	return nil;		// always print one page
       end,
     title: "Single Check",
     SetupItem:
       func(item, targetInfo)
       		begin
       			// set up the routing item if necessary
       			inherited:?SetupItem(item, targetInfo);
       
       			local string := "Check" && targetInfo.target.number;
       			if targetInfo.target.payee then
       				string := string && "to" && targetInfo.target.payee;
       			
       			item.title := string
       		end;,
     debug: "print",
     _proto: @200
    };

checkNumber :=
    {viewBounds: {left: 0, top: 27, right: 0, bottom: 53},
     viewJustify: 48,
     text: "Static Text",
     viewSetupFormScript:
       func()
       begin
       	if target.number then
       		text := "Check #" & FormattedNumberStr(target.number, "%0.0f");
       	else
       		text := "";
       end,
     debug: "checkNumber",
     _proto: @218
    };
AddStepForm(print, checkNumber);
StepDeclare(print, checkNumber, 'checkNumber);



date :=
    {viewBounds: {left: 0, top: 0, right: 0, bottom: 26},
     viewJustify: 8240,
     text: "Static Text",
     viewSetupFormScript:
       func()
       begin
       	if target.date then
       		text := "Date:" && ShortDateStr(target.date, kFormatDefault);
       	else
       		text := "";
       end,
     debug: "date",
     _proto: @218
    };
AddStepForm(print, date);
StepDeclare(print, date, 'date);



amount :=
    {viewBounds: {left: 0, top: 0, right: 0, bottom: 26},
     viewJustify: 8240,
     text: "Static Text",
     viewSetupFormScript:
       func()
       begin
       	if target.amount then
       		text := "Amount:" & FormattedNumberStr(target.amount, kFnBasicCurrency);
       	else
       		text := "";
       end,
     debug: "amount",
     _proto: @218
    };
AddStepForm(print, amount);



payee :=
    {viewBounds: {left: 0, top: 0, right: 0, bottom: 26},
     viewJustify: 8240,
     text: "Static Text",
     viewSetupFormScript:
       func()
       begin
       	if target.payee then
       		text := "Payee:" && target.payee;
       	else
       		text := "";
       end,
     debug: "payee",
     _proto: @218
    };
AddStepForm(print, payee);



memo :=
    {viewBounds: {left: 0, top: 0, right: 0, bottom: 26},
     viewJustify: 8240,
     text: "Static Text",
     viewSetupFormScript:
       func()
       begin
       	if target.memo then
       		text := "Memo:" & target.memo;
       	else
       		text := "";
       end,
     debug: "memo",
     _proto: @218
    };
AddStepForm(print, memo);



// After Script for "print"
thisView := print;
// Copyright ©1995 Apple Computer, Inc. All rights reserved



constant |layout_CheckPrintViewDef.t| := print;
// End of file CheckPrintViewDef.t
// Beginning of file PrefsView.t

// Before Script for "prefs"
// Copyright © 1996 by Apple Computer, Inc.  All rights reserved.


prefs :=
    {viewBounds: {left: 0, top: 0, right: 200, bottom: 88},
     prefs:
       // This slot will hold a reference to the application prefs frame
       nil,
     viewSetupFormScript:
       func()
       begin
       	// get the preferences frame and make sure that our application specific
       	// slot exists.  theApp is a reference to the applications base view
       	prefs := theApp:GetAppPreferences();
       	if NOT HasSlot( prefs, kAppSymbol ) then
       		prefs.(kAppSymbol) := Clone( kPrefsTemplate );
       end,
     declareSelf: 'base,
     viewJustify: 80,
     viewQuitScript:
       // must return the value of inherited:?viewQuitScript();
       func()
       begin
       	// clean up our stuff.  We don't need to write prefs back to the soup because
       	// newtApp does all that for us.
       	theApp:SaveAppState();
       	RemoveSlot(self, 'prefs);
       	RemoveSlot(self, 'theApp);
       	
       	inherited:?viewQuitScript();		// this method is defined internally
       end,
     ReOrientToScreen: ROM_DefRotateFunc ,
     debug: "prefs",
     _proto: @179
    };

_view002 :=
    {title: "Checkbook Preferences",
     viewBounds: {left: 0, top: 0, right: 90, bottom: 18},
     _proto: @229
    };
AddStepForm(prefs, _view002);



pref1 :=
    {text: "Pref 1",
     viewBounds: {left: 16, top: 22, right: 192, bottom: 36},
     valueChanged:
       func()
       begin
       	prefs.(kAppSymbol).pref1 := viewValue;
       end,
     viewSetupFormScript:
       func()
       begin
       	viewValue := prefs.(kAppSymbol).pref1;
       end,
     debug: "pref1",
     _proto: @164
    };
AddStepForm(prefs, pref1);



pref2 :=
    {text: "Pref 2",
     viewBounds: {left: 16, top: 39, right: 192, bottom: 52},
     valueChanged:
       func()
       begin
       	prefs.(kAppSymbol).pref2 := viewValue;
       end,
     viewSetupFormScript:
       func()
       begin
       	viewValue := prefs.(kAppSymbol).pref2;
       end,
     debug: "pref2",
     _proto: @164
    };
AddStepForm(prefs, pref2);



internalStore :=
    {text: "Always store new checks internally",
     viewBounds: {left: 16, top: 56, right: 192, bottom: 69},
     valueChanged:
       func()
       begin
       	prefs.internalStore := viewValue;
       end,
     viewSetupFormScript:
       func()
       begin
       	viewValue := prefs.internalStore;
       end,
     debug: "internalStore",
     _proto: @164
    };
AddStepForm(prefs, internalStore);



_view003 := {_proto: @163};
AddStepForm(prefs, _view003);




constant |layout_PrefsView.t| := prefs;
// End of file PrefsView.t
// Beginning of file CheckBase.t

// Before Script for "checkbookApp"
// Copyright ©1995 Apple Computer, Inc.  All rights reserved.


checkbookApp :=
    {prefsView: GetLayout("PrefsView.t"),
     allViewDefs:
       /*
        * the format of this slot is {datadefSym: {viewDef1Sym: theViewDef1, viewDef2Sym: theViewDef2 ...}
        *
        * This slot is evaluated at *compile time* and should reference the viewDefs that need to
        * be installed when the package is installed (mainly for Routing -- mail, print, fax, etc).
        * They need to be installed at part-install time so that printing (or other routing) can
        * occur when the application is not open.
        */
       
       result := {};
       result.(kCheckClassSym) := {};
       result.(kCheckClassSym).(kCheckFrameFormatSym) := kCheckFrameFormat;				// for beam, mail, etc
       result.(kCheckClassSym).(kCheckPrintFormatSym) := GetLayout("CheckPrintViewDef.t"); // for fax, print, etc...
       result;,
     viewQuitScript:
       func()
       begin
       	inherited:?viewQuitScript();		// this method is defined internally
       	RemoveSlot(self, 'viewBounds);
       end,
     appAll: "All Checks",
     GetRouteScripts:
       func(targetInfo)
       	begin
       		// merge our extraRouteScripts with the system ones
       		
       		local result := inherited:?GetRouteScripts(targetInfo);	// for future compatibility
       		if not result then
       			result := routeScripts;
       		result := Clone(result); 	// get writeable copy
       		ArrayMunger(result, 0, 0, extraRouteScripts, 0, nil);
       		result;
       	end,
     viewFlags: 5,
     ReOrientToScreen: ROM_DefRotateFunc,
     viewBounds: {left: 0, top: 0, right: 0, bottom: 0},
     appObject: ["Check", "Checks"],
     dateFindSlot: 'date,
     _proto: @398,
     allSoups:
       {
       	checkSoup: {
       		_proto: newtSoup,
       		soupName: "Checkbook:PIETraining",
       		soupIndices: [
       			{structure: 'slot, path: 'date, type: 'int},
       			{structure: 'slot, path: 'number, type: 'int},
       			{structure: 'multiSlot, path: ['date, 'number], type: ['int, 'int]},
       		],
       		soupQuery: {indexPath: ['date, 'number]},
       		soupDescr: "The Checkbook soup",
       		FillNewSoup: func()
       			begin
       				local store := if GetRoot().(kAppSymbol):GetAppPreferences().internalStore then
       					GetStores()[0];
       				else
       					GetDefaultStore();
       	
       				:AddEntry(self:CreateBlankEntry(), store);
       			end,
       		CreateBlankEntry : func()
       			begin
       				local newNumber := 100;
       				local e := theSoup:Query('{indexPath: number}):ResetToEnd();
       				if e then
       					newNumber := e.number + 1;
       				{
       					date: Time(),
       					payee: nil,
       					memo: nil,
       					amount: 0.0,
       					number: newNumber,
       					reconciled: nil,
       					class: kCheckClassSym,  // required for routing
       				};
       			end,
       	},
       },
     ReconcileChecks:
       func(target, targetView)
       	begin
       		local c := GetTargetCursor(target, nil);	// works even if target is a single entry
       		local e := c:Entry();
       		local newState := NOT e.reconciled;			// go by 1st entry
       		while e do
       			begin
       				e.reconciled := newState;
       				EntryChangeXmit(e, kAppSymbol);
       				e := c:Next();
       			end;
       		targetView:RedoChildren();
       	end,
     appSymbol: kAppSymbol,
     viewJustify: 240,
     extraRouteScripts:
       [
       	{
       		GetTitle: func(target)
       			if target then
       				if TargetIsCursor(target) then
       					if GetTargetCursor(target, nil):Entry().reconciled then
       						"Unreconcile"
       					else
       						"Reconcile" 
       				else
       					if target.reconciled then
       						"Unreconcile"
       					else
       						"Reconcile",
       		icon: kReconciledIcon,
       		routeScript: 'ReconcileChecks,
       	},
       ],
     title: kAppName,
     viewSetupFormScript:
       func()
       begin
       	inherited:?viewSetupFormScript();		// this method is defined internally
       	local bounds := :LocalBox();
       	if bounds.right > kMaxWidth or bounds.bottom > kMaxHeight then begin
       		self.viewBounds := Clone(self.viewBounds);
       		local extraH := Max(0, bounds.right - kMaxWidth);
       		local extraV := Max(0, bounds.bottom - kMaxHeight);
       		viewBounds.top := viewBounds.top + extraV div 2;
       		viewBounds.bottom := viewBounds.bottom - extraV div 2;
       		viewBounds.left := viewBounds.left + extraH div 2;
       		viewBounds.right := viewBounds.right - extraH div 2;
       	end;
       	local message;
       	if bounds.right < kMinWidth then
       		message := "Screen too narrow"
       	else if bounds.bottom < kMinHeight then
       		message := "Screen too short";
       	if message then
       		begin
       			self.viewBounds := RelBounds(-10, -10, 0, 0);	// removed in viewQuitScript
       			:Notify(kNotifyAlert, kAppName, message);
       			AddDeferredSend(self, 'Close, nil);
       		end;
       end,
     statusBarSlot:
       'status		// contains declared name of the status bar so layouts can use status bar.  Optional.
       ,
     FindSoupExcerpt:
       func(item, finder)
       begin
       	local s := ShortDateStr(item.date, 0);
       	s := s && $# & NumberStr(item.number);
       	if item.amount then
       		s := s && FormattedNumberStr(item.amount, kFnBasicCurrency);
       	s := s && "to" && item.payee;
       end,
     allLayouts:
       {
       	default: GetLayout("Default View.t"),
       	overview: GetLayout("Overview.t"),
       },
     PutAwayScript:
       func(item)
       	begin
       		local target := item.body;
       
       		// Routing requires you to verify that you can handle this type of
       		// data before trying to put away!
       		if classof(target) = kCheckClassSym and not TargetIsCursor(target) then
       			inherited:PutAwayScript(item);
       
       		// we cannot handle multiple-item targets or non-checks... so return NIL
       		// (NIL is the result of an if stmt that has no else clause)
       	end,
     debug: "checkbookApp",
     NewCheck:
       func()
       	begin
       		local newEntry := allSoups.checkSoup:CreateBlankEntry();
       		:AddEntry(newEntry);	// this is a newtApplication method that should/will be doc'd.
       	end
       
       /*
       		// This should work as well, but it has an unusual scrolling
       		// problem because ShowLayout currently happens at a deferred time.
       		
          		:ShowLayout('default);
       
          		local store := if :GetAppPreferences().internalStore then
          				GetStores()[0];
          			else
          				GetDefaultStore();
          		local newEntry := allSoups.checkSoup:CreateBlankEntry();
          		
          		// if we're in a folder, put the new check in the current folder
          		if labelsFilter and labelsFilter <> '_all then
          			newEntry.labels := labelsFilter;
          		
          		allSoups.checkSoup:AddEntry(newEntry, store);
          		layout.dataCursor:Goto(newEntry);
          		layout:NewTarget();
       */
    };

status :=
    {
     menuRightButtons:
       [
       	newtActionButton,
       	newtFilingButton,
       ],
     debug: "status",
     _proto: @401
    };
AddStepForm(checkbookApp, status);
StepDeclare(checkbookApp, status, 'status);



_view004 := {_proto: @162};
AddStepForm(checkbookApp, _view004);




constant |layout_CheckBase.t| := checkbookApp;
// End of file CheckBase.t
// Beginning of text file Install&Remove Scripts
/*
**      Newton Developer Technical Support Sample Code
**
**      Checkbook, a complete NewtApp sample
**
**      by Neil Rhodes, Calliope &
**		  Newton Developer Technical Support
**
**      Copyright © 1994-5 by Apple Computer, Inc.  All rights reserved.
**
**      You may incorporate this sample code into your applications without
**      restriction.  This sample code has been provided "AS IS" and the
**      responsibility for its operation is 100% yours.  You are not
**      permitted to modify and redistribute the source as "DTS Sample Code."
**      If you are going to re-distribute the source, we require that you
**      make it clear in the source that the code was descended from
**      Apple-provided sample code, but that you've made changes.
*/

InstallScript := func(partFrame)
begin
	local mainLayout := partFrame.theForm;
	
	partFrame.removeFrame := mainLayout:NewtInstallScript(mainLayout);
end;

RemoveScript := func(partFrame)
begin
	(partFrame.removeFrame):NewtRemoveScript(partFrame.removeFrame);
end;
// End of text file Install&Remove Scripts



